package hz.mobileproject.pda.toolsmanager.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.blankj.utilcode.util.TimeUtils;

import org.xutils.view.annotation.ViewInject;

import java.util.Date;
import java.util.List;

import hz.mobileproject.pda.R;
import hz.mobileproject.pda.toolsmanager.bean.response.RP_QUERY_KUCUN;
import hz.mobileproject.pda.ui.base.BaseCustomAdapter;

/**
 * Created by Lc on 2018/1/30.
 */

public class KuCunAdapter extends BaseCustomAdapter<RP_QUERY_KUCUN,KuCunAdapter.SearchVH> {


    public KuCunAdapter(Context mContext, List<RP_QUERY_KUCUN> list) {
        super(mContext, list);
    }

    @Override
    protected int bindView() {
        return R.layout.item_kucun_lv;
    }

    @Override
    protected SearchVH createViewHolder() {
        return new SearchVH();
    }

    @Override
    protected void bindData(int position, View convertView, SearchVH vh) {
        RP_QUERY_KUCUN bean = mList.get(position);
        vh.tv_dp.setText(bean.dept_name);
        vh.tv_ruku_person.setText(bean.person_name);
        vh.tv_tool_bh.setText(bean.tool_id);
        vh.tv_tool_name.setText(bean.tool_name);
        vh.tv_tool_lx.setText(bean.tool_type);

        vh.tv_rk_time.setText( TimeUtils.date2String(new Date(Long.parseLong(bean.add_time))));


    }

    class SearchVH{
        @ViewInject(R.id.tv_dp)
        private TextView tv_dp;
        @ViewInject(R.id.tv_ruku_person)
        private TextView tv_ruku_person;
        @ViewInject(R.id.tv_tool_bh)
        private TextView tv_tool_bh;
        @ViewInject(R.id.tv_tool_name)
        private TextView tv_tool_name;
        @ViewInject(R.id.tv_tool_lx)
        private TextView tv_tool_lx;
        @ViewInject(R.id.tv_rk_time)
        private TextView tv_rk_time;

    }
}
